package com.icard.wx.icardwx.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ConfigurationProperties
@Configuration
public class PropertyUtil {

    public static String AUTH_URL = "https://open.weixin.qq.com/connect/oauth2/authorize";

    public static String ACCESSTOEKN_AUTH_URL = "https://api.weixin.qq.com/sns/oauth2/access_token";

    private static String appid;

    private static String appsecret;

    private static String redirectDomain;

    private static String gatewayHost;

    public static String getGatewayHost() {
        return gatewayHost;
    }

    @Value("${gateway.host}")
    public void setGatewayHost(String gatewayHost) {
        PropertyUtil.gatewayHost = gatewayHost;
    }

    public static String getAppid() {
        return appid;
    }

    @Value("${wx.appid}")
    public  void setAppid(String appid) {
        PropertyUtil.appid = appid;
    }

    public static String getAppsecret() {
        return appsecret;
    }

    @Value("${wx.appsecret}")
    public  void setAppsecret(String appsecret) {
        PropertyUtil.appsecret = appsecret;
    }

    public static String getRedirectDomain() {
        return redirectDomain;
    }

    @Value("${wx.redirectDomain}")
    public  void setRedirectDomain(String redirectDomain) {
        PropertyUtil.redirectDomain = redirectDomain;
    }
}
